//
//  FPMeProfileController.m
//  FinanceProject
//
//  Created by 陈显摆 on 2025/3/12.
//

#import "FPMeProfileController.h"
#import "FPBankCardModel.h"
#import "FPAuthenticationFooterView.h"

@interface FPMeProfileController () <UITableViewDelegate , UITableViewDataSource , HJCActionSheetDelegate , UITextFieldDelegate>

@property (nonatomic , strong) FPAuthenticationFooterView *footerView;

@end

@implementation FPMeProfileController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)initUI {
    
    [self setTitle:@"我的资料" style:(XYCustomNavigationStyleWhite) hiddenBackBtn:NO];
    self.view.backgroundColor = [UIColor hexColor:@"#F4F6FA"];
    
    UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0.f, UIDevice.navigationFullHeight, SCREEN_WIDTH, 33.f + 12.f)];
    
    v.backgroundColor = UIColor.clearColor;
    
    UIView *headView = [[UIView alloc] initWithFrame:CGRectMake(16.f, 12.f, SCREEN_WIDTH - 32.f, 33.f)];
    headView.backgroundColor = [[UIColor hexColor:@"#0D6FFF"]colorWithAlphaComponent:.05f];
    headView.clipsToBounds = YES;
    headView.layer.cornerRadius = 8.f;
    [v addSubview:headView];
    
    UIImageView *iv = [[UIImageView alloc] initWithFrame:CGRectMake(12.f, 33.f / 2.f - 8.f, 16.f, 16.f)];
    [headView addSubview:iv];
    iv.image = IMG(@"icon_authentic_head");
    
    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(iv.right + 4.f, 0.f, SCREEN_WIDTH - iv.right - iv.left - 32.f, 33.f)];
    [headView addSubview:lab];
    lab.font = FONT(12.f);
    lab.textColor = [UIColor hexColor:@"#6A6A6A"];
    lab.text = @"国家级数据加密保护，仅用于贷款审核。";
    
    [self.view addSubview:v];
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];
    self.tableView.backgroundColor = UIColor.clearColor;//[UIColor colorWithHexString:@"#F4F6FA"];
    self.tableView.frame = CGRectMake(0.f, UIDevice.navigationFullHeight + v.height, SCREEN_WIDTH, SCREEN_HEIGHT - UIDevice.navigationFullHeight - v.height - 71.f - UIDevice.safeDistanceBottom);
    
    self.footerView = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(FPAuthenticationFooterView.class) owner:nil options:nil].lastObject;
    [self.view addSubview:self.footerView];
    self.footerView.frame = CGRectMake(0.f, SCREEN_HEIGHT - UIDevice.safeDistanceBottom - 71.f, SCREEN_WIDTH, 71.f);
    self.footerView.selectImgView.hidden = YES;
    self.footerView.privacyLab.hidden = YES;
    [self.footerView.nextBtn setTitle:@"提交" forState:(UIControlStateNormal)];
    self.footerView.topHeight.constant = -17.67f; //
    self.footerView.backgroundColor = [UIColor hexColor:@"#F4F6FA"];
    
    UIView *bottomV = [[UIView alloc] initWithFrame:CGRectMake(0.f, SCREEN_HEIGHT - UIDevice.safeDistanceBottom, SCREEN_WIDTH, UIDevice.safeDistanceBottom)];
    [self.view addSubview:bottomV];
    bottomV.backgroundColor = [UIColor hexColor:@"#F4F6FA"];
    
    [self.footerView.nextBtn handleViewControlEvents:UIControlEventTouchUpInside withBlock:^{
       
        NSLog(@"save~");
    }];
    
    NSDictionary *dic = [FPBankCardModel readJSONFileWithName:@"UserProfileConfig"];
    
    NSLog(@"%@",dic);
}


@end
